package com.fanshuai.springcloud.web.exception;

import com.fanshuai.springcloud.web.enums.StatusCode;
import lombok.Getter;

public class FanshuaiException extends RuntimeException {
    @Getter
    private int code;
    @Getter
    private String message;

    public FanshuaiException(int code) {
        super("");
        this.code = code;
        this.message = "";
    }

    public FanshuaiException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public FanshuaiException(StatusCode statusCodee) {
        super(statusCodee.desc);
        this.code = statusCodee.code;
        this.message = statusCodee.desc;
    }
}
